DB2 Index 索引操作SQL

Categories: Database; Tagged with: ; @ October 5th, 2010 20:15

以下罗列与Index有关操作的SQL, 如: List/CREATE/DROP 等操作.

1. List Indexes 获得所有索引

SELECT * FROM SYSIBM.SYSINDEXES WHERE CREATOR NOT LIKE ‘SYS%’ AND TBNAME=’tablename‘;

2. CREATE INDEX 创建索引

CREATE INDEX EMPLOYEE_EMPLOYEE_ID_IDX ON EMPLOYEE(EMPLOYEE_ID);
CREATE UNIQUE INDEX EMPLOYEE_NAME_IDX ON EMPLOYEE(NAME);

3. DROP INDEX 删除索引

DROP INDEX EMPLOYEE_ORGNO_IDX;

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.